/**
 *
 */
import Util;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;

extends OpenApi;


init(config: OpenApi.Config){
  super(config);
  @endpointRule = '';
  
  checkConfig(config);
  @endpoint = getEndpoint('advisor', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }
  
  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model RdAccountDTO {
  accountType?: string(name='AccountType'),
  checked?: boolean(name='Checked'),
  displayName?: string(name='DisplayName'),
  id?: long(name='Id'),
  name?: string(name='Name'),
  tags?: [ 
    {
      tagKey?: string(name='TagKey'),
      tagValue?: string(name='TagValue'),
    }
  ](name='Tags'),
}

model RdAccountFolderDTO {
  accountCount?: int32(name='AccountCount'),
  accountList?: [
    RdAccountDTO
  ](name='AccountList'),
  folderId?: string(name='FolderId'),
  folderList?: [
    RdAccountFolderDTO
  ](name='FolderList'),
  folderName?: string(name='FolderName'),
  resourceDirectoryId?: string(name='ResourceDirectoryId'),
  resourceDirectoryPath?: string(name='ResourceDirectoryPath'),
  resourceDirectoryPathName?: string(name='ResourceDirectoryPathName'),
  selectedCount?: int32(name='SelectedCount'),
}

model DescribeAdvicesRequest {
  adviceId?: long(name='AdviceId', example='12345678'),
  checkId?: string(name='CheckId', example='EcsHighCpuUtilization'),
  checkPlanId?: long(name='CheckPlanId'),
  excludeAdviceId?: long(name='ExcludeAdviceId', example='12345678'),
  language?: string(name='Language', example='zh'),
  product?: string(name='Product', example='ecs'),
  resourceId?: string(name='ResourceId', example='i-bp67acfmxazb4p****'),
}

model DescribeAdvicesResponseBody = {
  data?: {
    advice?: [ 
    {
      aliyunId?: long(name='AliyunId', example='1234567891234567'),
      checkId?: string(name='CheckId', example='EcsHighCpuUtilization'),
      checkName?: string(name='CheckName'),
      checkPlanId?: long(name='CheckPlanId'),
      content?: string(name='Content', example='[
	{
		"key":"EcsHighCpuUtilization_xxxx",
		"value":xxx
	},
	{
		"key":"EcsHighCpuUtilization_xxxx",
		"value":xxx
	},
	{
		"key":"EcsHighCpuUtilization_xxxx",
		"value":xxx
	},
]'),
      description?: string(name='Description'),
      gmtCreated?: string(name='GmtCreated', example='2023-07-01 00:00:00'),
      gmtModified?: string(name='GmtModified', example='2023-07-01 00:00:00'),
      id?: long(name='Id', description='ID', example='123'),
      isExpired?: boolean(name='IsExpired', example='false'),
      product?: string(name='Product', example='ecs'),
      resource?: string(name='Resource', example='{
	"resourceId": xxxx,
	"resourceName": xxxxxx,
	"regionId": xxxx,
	...
}'),
      resourceId?: string(name='ResourceId', example='i-bp67acfmxazb4p****'),
      severity?: int32(name='Severity', example='1'),
    }
  ](name='Advice')
  }(name='Data'),
  requestId?: string(name='RequestId', example='566331F9-5AB3-550F-B745-A730331F97A9'),
}

model DescribeAdvicesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeAdvicesResponseBody(name='body'),
}

/**
 * @summary 根据多个维度获取用户最新的巡检结果，全量返回-openApi
 *
 * @param request DescribeAdvicesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeAdvicesResponse
 */
async function describeAdvicesWithOptions(request: DescribeAdvicesRequest, runtime: Util.RuntimeOptions): DescribeAdvicesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.adviceId)) {
    query['AdviceId'] = request.adviceId;
  }
  if (!Util.isUnset(request.checkId)) {
    query['CheckId'] = request.checkId;
  }
  if (!Util.isUnset(request.checkPlanId)) {
    query['CheckPlanId'] = request.checkPlanId;
  }
  if (!Util.isUnset(request.excludeAdviceId)) {
    query['ExcludeAdviceId'] = request.excludeAdviceId;
  }
  if (!Util.isUnset(request.language)) {
    query['Language'] = request.language;
  }
  if (!Util.isUnset(request.product)) {
    query['Product'] = request.product;
  }
  if (!Util.isUnset(request.resourceId)) {
    query['ResourceId'] = request.resourceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeAdvices',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 根据多个维度获取用户最新的巡检结果，全量返回-openApi
 *
 * @param request DescribeAdvicesRequest
 * @return DescribeAdvicesResponse
 */
async function describeAdvices(request: DescribeAdvicesRequest): DescribeAdvicesResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeAdvicesWithOptions(request, runtime);
}

model DescribeAdvicesFlatPageRequest {
  adviceId?: long(name='AdviceId', example='12345678'),
  checkId?: string(name='CheckId', example='EcsHighCpuUtilization'),
  language?: string(name='Language', example='zh'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  product?: string(name='Product', example='ecs'),
  resourceId?: string(name='ResourceId', example='i-2zecnwitr2s7aca6****'),
}

model DescribeAdvicesFlatPageResponseBody = {
  data?: {
    pageNo?: long(name='PageNo', example='1'),
    pageSize?: long(name='PageSize', example='10'),
    result?: [ 
      {
        aliyunId?: long(name='AliyunId', example='192895059480****'),
        checkId?: string(name='CheckId', example='EcsHighCpuUtilization'),
        checkName?: string(name='CheckName'),
        content?: string(name='Content', example='[{"key":"EcsHighCpuUtilization_xxxx", "value":"xxx"}, {"key":"EcsHighCpuUtilization_xxxx", "value":"xxx"}, {"key":"EcsHighCpuUtilization_xxxx", "value":"xxx"}, ]'),
        description?: string(name='Description'),
        gmtCreated?: string(name='GmtCreated', example='2023-07-01 00:00:00'),
        gmtModified?: string(name='GmtModified', example='2023-07-01 00:00:00'),
        id?: long(name='Id', example='40200899'),
        isExpired?: boolean(name='IsExpired', example='false'),
        product?: string(name='Product', example='ecs'),
        resource?: string(name='Resource', example='{"resourceId": "i-2zecnwitr2s7aca6****","resourceName": "ecs-20230701","regionId": "cn-hangzhou",...}'),
        resourceId?: string(name='ResourceId', example='i-bp67acfmxazb4p****'),
        severity?: long(name='Severity', example='1'),
      }
    ](name='Result'),
    total?: long(name='Total', example='100'),
  }(name='Data'),
  requestId?: string(name='RequestId', example='566331F9-5AB3-550F-B745-A730331F97A9'),
}

model DescribeAdvicesFlatPageResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeAdvicesFlatPageResponseBody(name='body'),
}

/**
 * @summary DescribeAdvicesFlat分页
 *
 * @param request DescribeAdvicesFlatPageRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeAdvicesFlatPageResponse
 */
async function describeAdvicesFlatPageWithOptions(request: DescribeAdvicesFlatPageRequest, runtime: Util.RuntimeOptions): DescribeAdvicesFlatPageResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.adviceId)) {
    query['AdviceId'] = request.adviceId;
  }
  if (!Util.isUnset(request.checkId)) {
    query['CheckId'] = request.checkId;
  }
  if (!Util.isUnset(request.language)) {
    query['Language'] = request.language;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.product)) {
    query['Product'] = request.product;
  }
  if (!Util.isUnset(request.resourceId)) {
    query['ResourceId'] = request.resourceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeAdvicesFlatPage',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary DescribeAdvicesFlat分页
 *
 * @param request DescribeAdvicesFlatPageRequest
 * @return DescribeAdvicesFlatPageResponse
 */
async function describeAdvicesFlatPage(request: DescribeAdvicesFlatPageRequest): DescribeAdvicesFlatPageResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeAdvicesFlatPageWithOptions(request, runtime);
}

model DescribeAdvicesPageRequest {
  adviceId?: long(name='AdviceId', example='12345678'),
  checkId?: string(name='CheckId', example='EcsHighCpuUtilization'),
  checkPlanId?: long(name='CheckPlanId'),
  language?: string(name='Language', example='zh'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  product?: string(name='Product', example='ecs'),
  resourceId?: string(name='ResourceId', example='i-bp67acfmxazb4p****'),
}

model DescribeAdvicesPageResponseBody = {
  data?: {
    pageNo?: long(name='PageNo', example='1'),
    pageSize?: long(name='PageSize', example='10'),
    result?: [ 
      {
        aliyunId?: long(name='AliyunId', example='1234567891234567'),
        checkId?: string(name='CheckId', example='EcsHighCpuUtilization'),
        checkName?: string(name='CheckName'),
        content?: string(name='Content', example='[
	{
		"key":"EcsHighCpuUtilization_xxxx",
		"value":xxx
	},
	{
		"key":"EcsHighCpuUtilization_xxxx",
		"value":xxx
	},
	{
		"key":"EcsHighCpuUtilization_xxxx",
		"value":xxx
	},
]'),
        description?: string(name='Description'),
        gmtCreated?: string(name='GmtCreated', example='2023-07-01 00:00:00'),
        gmtModified?: string(name='GmtModified', example='2023-07-01 00:00:00'),
        id?: long(name='Id', description='ID', example='123'),
        isExpired?: boolean(name='IsExpired', example='false'),
        product?: string(name='Product', example='ecs'),
        resource?: string(name='Resource', example='{
	"resourceId": xxxx,
	"resourceName": xxxxxx,
	"regionId": xxxx,
	...
}'),
        resourceId?: string(name='ResourceId', example='i-bp67acfmxazb4p****'),
        severity?: long(name='Severity', example='1'),
      }
    ](name='Result'),
    total?: long(name='Total', example='100'),
  }(name='Data'),
  requestId?: string(name='RequestId', example='566331F9-5AB3-550F-B745-A730331F97A9'),
}

model DescribeAdvicesPageResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeAdvicesPageResponseBody(name='body'),
}

/**
 * @summary DescribeAdvices分页
 *
 * @param request DescribeAdvicesPageRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeAdvicesPageResponse
 */
async function describeAdvicesPageWithOptions(request: DescribeAdvicesPageRequest, runtime: Util.RuntimeOptions): DescribeAdvicesPageResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.adviceId)) {
    query['AdviceId'] = request.adviceId;
  }
  if (!Util.isUnset(request.checkId)) {
    query['CheckId'] = request.checkId;
  }
  if (!Util.isUnset(request.checkPlanId)) {
    query['CheckPlanId'] = request.checkPlanId;
  }
  if (!Util.isUnset(request.language)) {
    query['Language'] = request.language;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.product)) {
    query['Product'] = request.product;
  }
  if (!Util.isUnset(request.resourceId)) {
    query['ResourceId'] = request.resourceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeAdvicesPage',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary DescribeAdvices分页
 *
 * @param request DescribeAdvicesPageRequest
 * @return DescribeAdvicesPageResponse
 */
async function describeAdvicesPage(request: DescribeAdvicesPageRequest): DescribeAdvicesPageResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeAdvicesPageWithOptions(request, runtime);
}

model DescribeAdvisorChecksRequest {
  language?: string(name='Language', example='zh'),
  product?: string(name='Product', example='ecs'),
}

model DescribeAdvisorChecksResponseBody = {
  code?: string(name='Code', example='200'),
  data?: {
    advisorCheck?: [ 
    {
      category?: string(name='Category', example='1'),
      code?: string(name='Code', example='EcsHighCpuUtilization'),
      description?: string(name='Description'),
      gmtCreated?: string(name='GmtCreated', example='2023-07-01 00:00:00'),
      gmtModified?: string(name='GmtModified', example='2023-07-01 00:00:00'),
      name?: string(name='Name'),
      operateColumn?: string(name='OperateColumn'),
      product?: string(name='Product', example='ecs'),
      status?: string(name='Status', example='enabled'),
      tips?: string(name='Tips'),
      viewColumn?: string(name='ViewColumn', example='[
	{
		"key":"EcsHighCpuUtilization_xxxx",
		"type":"DEFAULT"
	},
	{
		"key":"EcsHighCpuUtilization_xxxx",
		"type":"DEFAULT"
	},
	{
		"key":"EcsHighCpuUtilization_xxxx",
		"type":"DEFAULT"
	},
]'),
    }
  ](name='AdvisorCheck')
  }(name='Data'),
  requestId?: string(name='RequestId', example='566331F9-5AB3-550F-B745-A730331F97A9'),
}

model DescribeAdvisorChecksResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeAdvisorChecksResponseBody(name='body'),
}

/**
 * @param request DescribeAdvisorChecksRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeAdvisorChecksResponse
 */
async function describeAdvisorChecksWithOptions(request: DescribeAdvisorChecksRequest, runtime: Util.RuntimeOptions): DescribeAdvisorChecksResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.language)) {
    query['Language'] = request.language;
  }
  if (!Util.isUnset(request.product)) {
    query['Product'] = request.product;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeAdvisorChecks',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request DescribeAdvisorChecksRequest
 * @return DescribeAdvisorChecksResponse
 */
async function describeAdvisorChecks(request: DescribeAdvisorChecksRequest): DescribeAdvisorChecksResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeAdvisorChecksWithOptions(request, runtime);
}

model DescribeAdvisorChecksFoPagesRequest {
  assumeAliyunId?: long(name='AssumeAliyunId', example='11*********35'),
  bizCategory?: string(name='BizCategory', example='2'),
  category?: string(name='Category', example='*'),
  checkTypes?: [ long ](name='CheckTypes'),
  name?: string(name='Name', example='****'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  product?: string(name='Product', example='ecs'),
  source?: string(name='Source', example='*'),
  status?: string(name='Status', example='enabled'),
  token?: string(name='Token', example='***'),
}

model DescribeAdvisorChecksFoPagesShrinkRequest {
  assumeAliyunId?: long(name='AssumeAliyunId', example='11*********35'),
  bizCategory?: string(name='BizCategory', example='2'),
  category?: string(name='Category', example='*'),
  checkTypesShrink?: string(name='CheckTypes'),
  name?: string(name='Name', example='****'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  product?: string(name='Product', example='ecs'),
  source?: string(name='Source', example='*'),
  status?: string(name='Status', example='enabled'),
  token?: string(name='Token', example='***'),
}

model DescribeAdvisorChecksFoPagesResponseBody = {
  code?: string(name='Code', example='200'),
  data?: [ 
    {
      pageNo?: int32(name='PageNo', example='1'),
      pageSize?: int32(name='PageSize', example='10'),
      result?: [ 
        {
          category?: string(name='Category', example='21'),
          code?: string(name='Code', example='EcsCostLowUtilizationCheck'),
          configSupport?: string(name='ConfigSupport', example='false'),
          description?: string(name='Description'),
          inspectionScope?: string(name='InspectionScope', example='false'),
          name?: string(name='Name'),
          operateColumn?: string(name='OperateColumn', example='[{\\\\"type\\\\":\\\\"template\\\\",\\\\"value\\\\":\\\\"cloudmonitor.console.aliyun.com/index.htm?custom_trace=ecs_console#/hostDetail/chart/instanceId=${Resource.resourceId}&system=Linux&region=${Resource.regionId}&aliyunhost=true\\\\",\\\\"key\\\\":\\\\"Detail\\\\"},{\\\\"type\\\\":\\\\"template\\\\",\\\\"value\\\\":\\\\"/diagnosis?product=${Product}&resourceId=${Resource.resourceId}\\\\",\\\\"key\\\\":\\\\"Refresh\\\\"}]'),
          product?: string(name='Product', example='ECS'),
          riskLevel?: long(name='RiskLevel'),
          source?: string(name='Source', example='Advisor'),
          status?: string(name='Status', example='enabled'),
          subCategory?: [ long ](name='SubCategory'),
          tips?: string(name='Tips'),
          viewColumn?: string(name='ViewColumn', example='[{\\\\"type\\\\":\\\\"DEFAULT\\\\",\\\\"key\\\\":\\\\"EcsCostIdleCheck_resourceId\\\\"},{\\\\"type\\\\":\\\\"DEFAULT\\\\",\\\\"key\\\\":\\\\"EcsCostIdleCheck_resourceName\\\\"},{\\\\"type\\\\":\\\\"DEFAULT\\\\",\\\\"key\\\\":\\\\"EcsCostIdleCheck_regionId\\\\"},{\\\\"type\\\\":\\\\"DEFAULT\\\\",\\\\"key\\\\":\\\\"EcsCostIdleCheck_instanceChargeType\\\\"},{\\\\"type\\\\":\\\\"DEFAULT\\\\",\\\\"key\\\\":\\\\"EcsCostIdleCheck_instanceType\\\\"},{\\\\"type\\\\":\\\\"DEFAULT\\\\",\\\\"key\\\\":\\\\"EcsCostIdleCheck_severity\\\\"},{\\\\"type\\\\":\\\\"DEFAULT\\\\",\\\\"key\\\\":\\\\"EcsCostIdleCheck_costBefore\\\\"},{\\\\"type\\\\":\\\\"DEFAULT\\\\",\\\\"key\\\\":\\\\"EcsCostIdleCheck_costAfter\\\\"},{\\\\"type\\\\":\\\\"DEFAULT\\\\",\\\\"key\\\\":\\\\"EcsCostIdleCheck_costSavings\\\\"},{\\\\"type\\\\":\\\\"DEFAULT\\\\",\\\\"key\\\\":\\\\"First_time\\\\"},{\\\\"type\\\\":\\\\"DEFAULT\\\\",\\\\"key\\\\":\\\\"Duration_time\\\\"}]'),
        }
      ](name='Result'),
      total?: int32(name='Total', example='100'),
    }
  ](name='Data'),
  message?: string(name='Message', example='OK'),
  requestId?: string(name='RequestId', description='Id of the request', example='566331F9-5AB3-550F-B745-A730331F97A9'),
  success?: boolean(name='Success', example='True'),
}

model DescribeAdvisorChecksFoPagesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeAdvisorChecksFoPagesResponseBody(name='body'),
}

/**
 * @summary 巡检项设置-分页
 *
 * @param tmpReq DescribeAdvisorChecksFoPagesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeAdvisorChecksFoPagesResponse
 */
async function describeAdvisorChecksFoPagesWithOptions(tmpReq: DescribeAdvisorChecksFoPagesRequest, runtime: Util.RuntimeOptions): DescribeAdvisorChecksFoPagesResponse {
  Util.validateModel(tmpReq);
  var request = new DescribeAdvisorChecksFoPagesShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.checkTypes)) {
    request.checkTypesShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.checkTypes, 'CheckTypes', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.assumeAliyunId)) {
    query['AssumeAliyunId'] = request.assumeAliyunId;
  }
  if (!Util.isUnset(request.bizCategory)) {
    query['BizCategory'] = request.bizCategory;
  }
  if (!Util.isUnset(request.category)) {
    query['Category'] = request.category;
  }
  if (!Util.isUnset(request.checkTypesShrink)) {
    query['CheckTypes'] = request.checkTypesShrink;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.product)) {
    query['Product'] = request.product;
  }
  if (!Util.isUnset(request.source)) {
    query['Source'] = request.source;
  }
  if (!Util.isUnset(request.status)) {
    query['Status'] = request.status;
  }
  if (!Util.isUnset(request.token)) {
    query['Token'] = request.token;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeAdvisorChecksFoPages',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 巡检项设置-分页
 *
 * @param request DescribeAdvisorChecksFoPagesRequest
 * @return DescribeAdvisorChecksFoPagesResponse
 */
async function describeAdvisorChecksFoPages(request: DescribeAdvisorChecksFoPagesRequest): DescribeAdvisorChecksFoPagesResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeAdvisorChecksFoPagesWithOptions(request, runtime);
}

model DescribeAdvisorResourcesRequest {
  keyword?: string(name='Keyword', example='abcd'),
  language?: string(name='Language', example='zh'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  product?: string(name='Product', example='ecs'),
  resourceId?: string(name='ResourceId', example='i-bp67acfmxazb4p****'),
}

model DescribeAdvisorResourcesResponseBody = {
  data?: {
    pageNo?: int32(name='PageNo', example='1'),
    pageSize?: int32(name='PageSize', example='10'),
    result?: {
      resource?: [ 
      {
        data?: string(name='Data', example='{
    "resourceId": "xxxxx",
    "deviceAvailable": true,
    ...
}'),
        product?: string(name='Product', example='ecs'),
        regionId?: string(name='RegionId', example='cn-hangzhou'),
        resourceId?: string(name='ResourceId', example='i-bp67acfmxazb4p****'),
        resourceName?: string(name='ResourceName', example='ecs-20230701'),
      }
    ](name='Resource')
    }(name='Result'),
    total?: int32(name='Total', example='100'),
  }(name='Data'),
  requestId?: string(name='RequestId', example='566331F9-5AB3-550F-B745-A730331F97A9'),
}

model DescribeAdvisorResourcesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeAdvisorResourcesResponseBody(name='body'),
}

/**
 * @param request DescribeAdvisorResourcesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeAdvisorResourcesResponse
 */
async function describeAdvisorResourcesWithOptions(request: DescribeAdvisorResourcesRequest, runtime: Util.RuntimeOptions): DescribeAdvisorResourcesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.keyword)) {
    query['Keyword'] = request.keyword;
  }
  if (!Util.isUnset(request.language)) {
    query['Language'] = request.language;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.product)) {
    query['Product'] = request.product;
  }
  if (!Util.isUnset(request.resourceId)) {
    query['ResourceId'] = request.resourceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeAdvisorResources',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request DescribeAdvisorResourcesRequest
 * @return DescribeAdvisorResourcesResponse
 */
async function describeAdvisorResources(request: DescribeAdvisorResourcesRequest): DescribeAdvisorResourcesResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeAdvisorResourcesWithOptions(request, runtime);
}

model DescribeCostCheckAdvicesRequest {
  assumeAliyunIdList?: [ long ](name='AssumeAliyunIdList'),
  checkId?: string(name='CheckId', example='EcsCostLowUtilizationCheck'),
  checkPlanId?: long(name='CheckPlanId'),
  language?: string(name='Language', example='zh'),
  pageNumber?: int32(name='PageNumber', example='6'),
  pageSize?: int32(name='PageSize', example='10'),
  regionIds?: [ string ](name='RegionIds'),
  resourceGroupIdList?: [ string ](name='ResourceGroupIdList'),
  resourceId?: string(name='ResourceId'),
  resourceIds?: [ string ](name='ResourceIds'),
  resourceName?: string(name='ResourceName', example='test'),
  severity?: string(name='Severity', example='1'),
  tagKeys?: [ string ](name='TagKeys'),
  tagList?: [ 
    {
      tagKey?: string(name='TagKey', example='ecs_***_shanghai'),
      tagValue?: [ string ](name='TagValue'),
    }
  ](name='TagList'),
  tagValues?: [ string ](name='TagValues'),
}

model DescribeCostCheckAdvicesShrinkRequest {
  assumeAliyunIdListShrink?: string(name='AssumeAliyunIdList'),
  checkId?: string(name='CheckId', example='EcsCostLowUtilizationCheck'),
  checkPlanId?: long(name='CheckPlanId'),
  language?: string(name='Language', example='zh'),
  pageNumber?: int32(name='PageNumber', example='6'),
  pageSize?: int32(name='PageSize', example='10'),
  regionIdsShrink?: string(name='RegionIds'),
  resourceGroupIdListShrink?: string(name='ResourceGroupIdList'),
  resourceId?: string(name='ResourceId'),
  resourceIdsShrink?: string(name='ResourceIds'),
  resourceName?: string(name='ResourceName', example='test'),
  severity?: string(name='Severity', example='1'),
  tagKeysShrink?: string(name='TagKeys'),
  tagListShrink?: string(name='TagList'),
  tagValuesShrink?: string(name='TagValues'),
}

model DescribeCostCheckAdvicesResponseBody = {
  code?: string(name='Code', example='200'),
  data?: {
    adviceList?: [ 
      {
        accountFolderId?: string(name='AccountFolderId', example='1'),
        accountFolderName?: string(name='AccountFolderName', example='1'),
        aliyunId?: long(name='AliyunId', example='111******767'),
        content?: string(name='Content', example='{\\\\"Domains\\\\": [{\\\\"Status\\\\": \\\\"success\\\\", \\\\"\\\\": \\\\"cn\\\\", \\\\"DomainName\\\\": \\\\"www.****.com\\\\", Region\\\\"Desc\\\\": \\\\"ok\\\\"}]}'),
        email?: string(name='Email', description='Email', example='xxx'),
        endTime?: long(name='EndTime', example='2025-03-05T02:02:00Z'),
        gmtDeleted?: long(name='GmtDeleted', example='2025-03-05T02:02:00Z'),
        product?: string(name='Product', example='ecs'),
        regionId?: string(name='RegionId', example='cn-shanghai'),
        resourceId?: string(name='ResourceId', example='i-2ze5*****ef7d2lk63in'),
        resourceName?: string(name='ResourceName', example='1200***bles_df'),
        severity?: string(name='Severity', example='1'),
        startTime?: long(name='StartTime', example='2025-02-04T16:00:00Z'),
        tags?: [ 
          {
            tagKey?: string(name='TagKey', example='autoTest-7'),
            tagValue?: string(name='TagValue', example='basic'),
          }
        ](name='Tags'),
        url?: string(name='Url'),
        userName?: string(name='UserName', example='test'),
        zoneId?: string(name='ZoneId', example='cn-beijing-h'),
      }
    ](name='AdviceList'),
    checkId?: string(name='CheckId', example='EcsHighCpuUtilization'),
    pageNumber?: int32(name='PageNumber', example='4'),
    pageSize?: int32(name='PageSize', example='10'),
    totalCount?: int32(name='TotalCount', example='0'),
  }(name='Data'),
  message?: string(name='Message', example='OK'),
  requestId?: string(name='RequestId', description='Id of the request', example='566331F9-****-550F-B745-A730331F97A9'),
  success?: string(name='Success', example='True'),
}

model DescribeCostCheckAdvicesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeCostCheckAdvicesResponseBody(name='body'),
}

/**
 * @summary 查询成本优化结果详情
 *
 * @param tmpReq DescribeCostCheckAdvicesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeCostCheckAdvicesResponse
 */
async function describeCostCheckAdvicesWithOptions(tmpReq: DescribeCostCheckAdvicesRequest, runtime: Util.RuntimeOptions): DescribeCostCheckAdvicesResponse {
  Util.validateModel(tmpReq);
  var request = new DescribeCostCheckAdvicesShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.assumeAliyunIdList)) {
    request.assumeAliyunIdListShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.assumeAliyunIdList, 'AssumeAliyunIdList', 'json');
  }
  if (!Util.isUnset(tmpReq.regionIds)) {
    request.regionIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.regionIds, 'RegionIds', 'json');
  }
  if (!Util.isUnset(tmpReq.resourceGroupIdList)) {
    request.resourceGroupIdListShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.resourceGroupIdList, 'ResourceGroupIdList', 'json');
  }
  if (!Util.isUnset(tmpReq.resourceIds)) {
    request.resourceIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.resourceIds, 'ResourceIds', 'json');
  }
  if (!Util.isUnset(tmpReq.tagKeys)) {
    request.tagKeysShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.tagKeys, 'TagKeys', 'json');
  }
  if (!Util.isUnset(tmpReq.tagList)) {
    request.tagListShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.tagList, 'TagList', 'json');
  }
  if (!Util.isUnset(tmpReq.tagValues)) {
    request.tagValuesShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.tagValues, 'TagValues', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.assumeAliyunIdListShrink)) {
    query['AssumeAliyunIdList'] = request.assumeAliyunIdListShrink;
  }
  if (!Util.isUnset(request.checkId)) {
    query['CheckId'] = request.checkId;
  }
  if (!Util.isUnset(request.checkPlanId)) {
    query['CheckPlanId'] = request.checkPlanId;
  }
  if (!Util.isUnset(request.language)) {
    query['Language'] = request.language;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.regionIdsShrink)) {
    query['RegionIds'] = request.regionIdsShrink;
  }
  if (!Util.isUnset(request.resourceGroupIdListShrink)) {
    query['ResourceGroupIdList'] = request.resourceGroupIdListShrink;
  }
  if (!Util.isUnset(request.resourceId)) {
    query['ResourceId'] = request.resourceId;
  }
  if (!Util.isUnset(request.resourceIdsShrink)) {
    query['ResourceIds'] = request.resourceIdsShrink;
  }
  if (!Util.isUnset(request.resourceName)) {
    query['ResourceName'] = request.resourceName;
  }
  if (!Util.isUnset(request.severity)) {
    query['Severity'] = request.severity;
  }
  if (!Util.isUnset(request.tagKeysShrink)) {
    query['TagKeys'] = request.tagKeysShrink;
  }
  if (!Util.isUnset(request.tagListShrink)) {
    query['TagList'] = request.tagListShrink;
  }
  if (!Util.isUnset(request.tagValuesShrink)) {
    query['TagValues'] = request.tagValuesShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeCostCheckAdvices',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询成本优化结果详情
 *
 * @param request DescribeCostCheckAdvicesRequest
 * @return DescribeCostCheckAdvicesResponse
 */
async function describeCostCheckAdvices(request: DescribeCostCheckAdvicesRequest): DescribeCostCheckAdvicesResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeCostCheckAdvicesWithOptions(request, runtime);
}

model DescribeCostCheckResultsRequest {
  assumeAliyunIdList?: [ long ](name='AssumeAliyunIdList'),
  checkIds?: [ string ](name='CheckIds'),
  checkPlanId?: long(name='CheckPlanId'),
  groupBy?: string(name='GroupBy', example='Category'),
  product?: string(name='Product', example='ecs'),
  regionIds?: [ string ](name='RegionIds'),
  resourceGroupIdList?: [ string ](name='ResourceGroupIdList'),
  resourceId?: string(name='ResourceId'),
  resourceIds?: [ string ](name='ResourceIds'),
  resourceName?: string(name='ResourceName', example='SYNC_********_TASK'),
  severity?: int32(name='Severity', example='1'),
  tagKeys?: [ string ](name='TagKeys'),
  tagList?: [ 
    {
      tagKey?: string(name='TagKey', example='ERP'),
      tagValue?: [ string ](name='TagValue'),
    }
  ](name='TagList'),
  tagValues?: [ string ](name='TagValues'),
}

model DescribeCostCheckResultsShrinkRequest {
  assumeAliyunIdListShrink?: string(name='AssumeAliyunIdList'),
  checkIdsShrink?: string(name='CheckIds'),
  checkPlanId?: long(name='CheckPlanId'),
  groupBy?: string(name='GroupBy', example='Category'),
  product?: string(name='Product', example='ecs'),
  regionIdsShrink?: string(name='RegionIds'),
  resourceGroupIdListShrink?: string(name='ResourceGroupIdList'),
  resourceId?: string(name='ResourceId'),
  resourceIdsShrink?: string(name='ResourceIds'),
  resourceName?: string(name='ResourceName', example='SYNC_********_TASK'),
  severity?: int32(name='Severity', example='1'),
  tagKeysShrink?: string(name='TagKeys'),
  tagListShrink?: string(name='TagList'),
  tagValuesShrink?: string(name='TagValues'),
}

model DescribeCostCheckResultsResponseBody = {
  code?: string(name='Code', example='200'),
  data?: {
    adviceResourceCount?: int32(name='AdviceResourceCount'),
    groupBy?: string(name='GroupBy', example='Category'),
    normalCount?: int32(name='NormalCount', example='1'),
    resourceCount?: int32(name='ResourceCount', example='76'),
    totalCount?: int32(name='TotalCount', example='4'),
    viewGroup?: [ 
      {
        checkItems?: [ 
          {
            adviceCount?: int32(name='AdviceCount', example='100'),
            adviceResourceCount?: int32(name='AdviceResourceCount', example='1'),
            category?: string(name='Category', example='4'),
            checkId?: string(name='CheckId', example='EbsCostIdleCheck'),
            checkName?: string(name='CheckName'),
            currentCost?: float(name='CurrentCost', example='1'),
            description?: string(name='Description'),
            expectedSavingCost?: float(name='ExpectedSavingCost', example='1'),
            optimizedCost?: float(name='OptimizedCost', example='1'),
            product?: string(name='Product', example='slb'),
            severity?: int32(name='Severity', example='1'),
            summary?: string(name='Summary', example='true'),
            tips?: string(name='Tips'),
          }
        ](name='CheckItems'),
        groupCode?: string(name='GroupCode', example='22'),
        groupCount?: int32(name='GroupCount', example='0'),
        groupExpectedSavingCost?: float(name='GroupExpectedSavingCost', example='1'),
        groupName?: string(name='GroupName', example='aut***8ainRh1'),
      }
    ](name='ViewGroup'),
    warningCount?: int32(name='WarningCount', example='1'),
  }(name='Data'),
  message?: string(name='Message', example='OK'),
  requestId?: string(name='RequestId', description='Id of the request', example='566331F9-****-550F-B745-A730331F97A9'),
  success?: string(name='Success', example='True'),
}

model DescribeCostCheckResultsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeCostCheckResultsResponseBody(name='body'),
}

/**
 * @summary 查询巡检项聚合成本优化结果概览
 *
 * @param tmpReq DescribeCostCheckResultsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeCostCheckResultsResponse
 */
async function describeCostCheckResultsWithOptions(tmpReq: DescribeCostCheckResultsRequest, runtime: Util.RuntimeOptions): DescribeCostCheckResultsResponse {
  Util.validateModel(tmpReq);
  var request = new DescribeCostCheckResultsShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.assumeAliyunIdList)) {
    request.assumeAliyunIdListShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.assumeAliyunIdList, 'AssumeAliyunIdList', 'json');
  }
  if (!Util.isUnset(tmpReq.checkIds)) {
    request.checkIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.checkIds, 'CheckIds', 'json');
  }
  if (!Util.isUnset(tmpReq.regionIds)) {
    request.regionIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.regionIds, 'RegionIds', 'json');
  }
  if (!Util.isUnset(tmpReq.resourceGroupIdList)) {
    request.resourceGroupIdListShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.resourceGroupIdList, 'ResourceGroupIdList', 'json');
  }
  if (!Util.isUnset(tmpReq.resourceIds)) {
    request.resourceIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.resourceIds, 'ResourceIds', 'json');
  }
  if (!Util.isUnset(tmpReq.tagKeys)) {
    request.tagKeysShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.tagKeys, 'TagKeys', 'json');
  }
  if (!Util.isUnset(tmpReq.tagList)) {
    request.tagListShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.tagList, 'TagList', 'json');
  }
  if (!Util.isUnset(tmpReq.tagValues)) {
    request.tagValuesShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.tagValues, 'TagValues', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.assumeAliyunIdListShrink)) {
    query['AssumeAliyunIdList'] = request.assumeAliyunIdListShrink;
  }
  if (!Util.isUnset(request.checkIdsShrink)) {
    query['CheckIds'] = request.checkIdsShrink;
  }
  if (!Util.isUnset(request.checkPlanId)) {
    query['CheckPlanId'] = request.checkPlanId;
  }
  if (!Util.isUnset(request.groupBy)) {
    query['GroupBy'] = request.groupBy;
  }
  if (!Util.isUnset(request.product)) {
    query['Product'] = request.product;
  }
  if (!Util.isUnset(request.regionIdsShrink)) {
    query['RegionIds'] = request.regionIdsShrink;
  }
  if (!Util.isUnset(request.resourceGroupIdListShrink)) {
    query['ResourceGroupIdList'] = request.resourceGroupIdListShrink;
  }
  if (!Util.isUnset(request.resourceId)) {
    query['ResourceId'] = request.resourceId;
  }
  if (!Util.isUnset(request.resourceIdsShrink)) {
    query['ResourceIds'] = request.resourceIdsShrink;
  }
  if (!Util.isUnset(request.resourceName)) {
    query['ResourceName'] = request.resourceName;
  }
  if (!Util.isUnset(request.severity)) {
    query['Severity'] = request.severity;
  }
  if (!Util.isUnset(request.tagKeysShrink)) {
    query['TagKeys'] = request.tagKeysShrink;
  }
  if (!Util.isUnset(request.tagListShrink)) {
    query['TagList'] = request.tagListShrink;
  }
  if (!Util.isUnset(request.tagValuesShrink)) {
    query['TagValues'] = request.tagValuesShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeCostCheckResults',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询巡检项聚合成本优化结果概览
 *
 * @param request DescribeCostCheckResultsRequest
 * @return DescribeCostCheckResultsResponse
 */
async function describeCostCheckResults(request: DescribeCostCheckResultsRequest): DescribeCostCheckResultsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeCostCheckResultsWithOptions(request, runtime);
}

model DescribeCostOptimizationOverviewRequest {
  assumeAliyunId?: long(name='AssumeAliyunId', example='11***********35'),
  assumeAliyunIdList?: [ long ](name='AssumeAliyunIdList'),
  checkPlanId?: long(name='CheckPlanId'),
  token?: string(name='Token', example='***'),
}

model DescribeCostOptimizationOverviewShrinkRequest {
  assumeAliyunId?: long(name='AssumeAliyunId', example='11***********35'),
  assumeAliyunIdListShrink?: string(name='AssumeAliyunIdList'),
  checkPlanId?: long(name='CheckPlanId'),
  token?: string(name='Token', example='***'),
}

model DescribeCostOptimizationOverviewResponseBody = {
  accessDeniedDetail?: {
    authAction?: string(name='AuthAction', description='AuthAction', example='null'),
    authPrincipalDisplayName?: string(name='AuthPrincipalDisplayName', example='null'),
    authPrincipalOwnerId?: string(name='AuthPrincipalOwnerId', example='null'),
    authPrincipalType?: string(name='AuthPrincipalType', example='null'),
    encodedDiagnosticMessage?: string(name='EncodedDiagnosticMessage', example='*****'),
    noPermissionType?: string(name='NoPermissionType', example='null'),
    policyType?: string(name='PolicyType', example='PauseNotify'),
  }(name='AccessDeniedDetail'),
  code?: string(name='Code', example='200'),
  data?: {
    billingCycleDate?: string(name='BillingCycleDate', example='100'),
    currentBillingCost?: string(name='CurrentBillingCost', example='100'),
    expectedSavingCost?: string(name='ExpectedSavingCost', example='100'),
    gmtModified?: long(name='GmtModified', example='2023-07-01 00:00:00'),
    optCheckItemNum?: string(name='OptCheckItemNum', example='100'),
    optResourceNum?: string(name='OptResourceNum', example='100'),
    processedResourceCount?: string(name='ProcessedResourceCount'),
    processedSaveAmount?: string(name='ProcessedSaveAmount'),
    taskId?: long(name='TaskId', example='95***135'),
    waitProcessResourceCount?: string(name='WaitProcessResourceCount'),
  }(name='Data'),
  message?: string(name='Message', example='Internal service issue. Detail:.'),
  requestId?: string(name='RequestId', description='Id of the request', example='566331F9-****-550F-B745-A730331F97A9'),
  success?: boolean(name='Success', example='True'),
}

model DescribeCostOptimizationOverviewResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeCostOptimizationOverviewResponseBody(name='body'),
}

/**
 * @summary 成本优化-概览
 *
 * @param tmpReq DescribeCostOptimizationOverviewRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeCostOptimizationOverviewResponse
 */
async function describeCostOptimizationOverviewWithOptions(tmpReq: DescribeCostOptimizationOverviewRequest, runtime: Util.RuntimeOptions): DescribeCostOptimizationOverviewResponse {
  Util.validateModel(tmpReq);
  var request = new DescribeCostOptimizationOverviewShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.assumeAliyunIdList)) {
    request.assumeAliyunIdListShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.assumeAliyunIdList, 'AssumeAliyunIdList', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.assumeAliyunId)) {
    query['AssumeAliyunId'] = request.assumeAliyunId;
  }
  if (!Util.isUnset(request.assumeAliyunIdListShrink)) {
    query['AssumeAliyunIdList'] = request.assumeAliyunIdListShrink;
  }
  if (!Util.isUnset(request.checkPlanId)) {
    query['CheckPlanId'] = request.checkPlanId;
  }
  if (!Util.isUnset(request.token)) {
    query['Token'] = request.token;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeCostOptimizationOverview',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 成本优化-概览
 *
 * @param request DescribeCostOptimizationOverviewRequest
 * @return DescribeCostOptimizationOverviewResponse
 */
async function describeCostOptimizationOverview(request: DescribeCostOptimizationOverviewRequest): DescribeCostOptimizationOverviewResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeCostOptimizationOverviewWithOptions(request, runtime);
}

model GetHistoryAdvicesRequest {
  endDate?: string(name='EndDate', example='2023-07-01'),
  language?: string(name='Language', example='zh'),
  pageNum?: int32(name='PageNum', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  product?: string(name='Product', example='ecs'),
  reverse?: boolean(name='Reverse', example='true'),
  severity?: string(name='Severity', example='1'),
  startDate?: string(name='StartDate', example='2023-07-01'),
}

model GetHistoryAdvicesResponseBody = {
  data?: {
    pageNo?: int32(name='PageNo', example='1'),
    result?: [ 
      {
        checkId?: string(name='CheckId', example='EcsHighCpuUtilization'),
        checkName?: string(name='CheckName'),
        description?: string(name='Description'),
        gmtCreated?: string(name='GmtCreated', example='2023-07-01 00:00:00'),
        product?: string(name='Product', example='ecs'),
        resourceId?: string(name='ResourceId', example='i-bp67acfmxazb4p****'),
        severity?: int32(name='Severity', example='1'),
        url?: string(name='Url'),
      }
    ](name='Result'),
    total?: int32(name='Total', example='100'),
  }(name='Data'),
  requestId?: string(name='RequestId', example='566331F9-5AB3-550F-B745-A730331F97A9'),
}

model GetHistoryAdvicesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetHistoryAdvicesResponseBody(name='body'),
}

/**
 * @param request GetHistoryAdvicesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetHistoryAdvicesResponse
 */
async function getHistoryAdvicesWithOptions(request: GetHistoryAdvicesRequest, runtime: Util.RuntimeOptions): GetHistoryAdvicesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.endDate)) {
    query['EndDate'] = request.endDate;
  }
  if (!Util.isUnset(request.language)) {
    query['Language'] = request.language;
  }
  if (!Util.isUnset(request.pageNum)) {
    query['PageNum'] = request.pageNum;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.product)) {
    query['Product'] = request.product;
  }
  if (!Util.isUnset(request.reverse)) {
    query['Reverse'] = request.reverse;
  }
  if (!Util.isUnset(request.severity)) {
    query['Severity'] = request.severity;
  }
  if (!Util.isUnset(request.startDate)) {
    query['StartDate'] = request.startDate;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetHistoryAdvices',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request GetHistoryAdvicesRequest
 * @return GetHistoryAdvicesResponse
 */
async function getHistoryAdvices(request: GetHistoryAdvicesRequest): GetHistoryAdvicesResponse {
  var runtime = new Util.RuntimeOptions{};
  return getHistoryAdvicesWithOptions(request, runtime);
}

model GetInspectProgressRequest {
  assumeAliyunId?: long(name='AssumeAliyunId', example='14********37'),
  taskId?: long(name='TaskId', example='95***135'),
  token?: string(name='Token', example='***'),
}

model GetInspectProgressResponseBody = {
  code?: string(name='Code', example='200'),
  data?: {
    allSubtaskCount?: int32(name='AllSubtaskCount', example='100'),
    finish?: boolean(name='Finish', example='True'),
    finishRate?: double(name='FinishRate', example='1'),
    finishSubtaskCount?: int32(name='FinishSubtaskCount', example='1'),
    lastInspectDate?: long(name='LastInspectDate', example='111'),
    taskId?: long(name='TaskId', example='95***135'),
    usedTime?: long(name='UsedTime', example='1'),
  }(name='Data'),
  message?: string(name='Message', example='Successful'),
  requestId?: string(name='RequestId', description='Id of the request', example='566331F9-****-550F-B745-A730331F97A9'),
  success?: boolean(name='Success', example='True'),
}

model GetInspectProgressResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetInspectProgressResponseBody(name='body'),
}

/**
 * @summary 获取任务执行进度(普通用户、RD单账号)
 *
 * @param request GetInspectProgressRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetInspectProgressResponse
 */
async function getInspectProgressWithOptions(request: GetInspectProgressRequest, runtime: Util.RuntimeOptions): GetInspectProgressResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.assumeAliyunId)) {
    query['AssumeAliyunId'] = request.assumeAliyunId;
  }
  if (!Util.isUnset(request.taskId)) {
    query['TaskId'] = request.taskId;
  }
  if (!Util.isUnset(request.token)) {
    query['Token'] = request.token;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetInspectProgress',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取任务执行进度(普通用户、RD单账号)
 *
 * @param request GetInspectProgressRequest
 * @return GetInspectProgressResponse
 */
async function getInspectProgress(request: GetInspectProgressRequest): GetInspectProgressResponse {
  var runtime = new Util.RuntimeOptions{};
  return getInspectProgressWithOptions(request, runtime);
}

model GetProductListRequest {
  token?: string(name='Token', example='****'),
}

model GetProductListResponseBody = {
  accessDeniedDetail?: {
    authAction?: string(name='AuthAction', example='*'),
    authPrincipalDisplayName?: string(name='AuthPrincipalDisplayName', example='*'),
    authPrincipalOwnerId?: string(name='AuthPrincipalOwnerId', example='*'),
    authPrincipalType?: string(name='AuthPrincipalType', example='*'),
    encodedDiagnosticMessage?: string(name='EncodedDiagnosticMessage', example='****'),
    noPermissionType?: string(name='NoPermissionType', example='*'),
    policyType?: string(name='PolicyType', example='*'),
  }(name='AccessDeniedDetail'),
  code?: string(name='Code', example='200'),
  data?: [ 
    {
      category?: string(name='Category'),
      productList?: [ 
        {
          newLabel?: string(name='NewLabel'),
          product?: string(name='Product', example='hologres'),
        }
      ](name='ProductList'),
    }
  ](name='Data'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='566331F9-****-550F-B745-A730331F97A9'),
  success?: boolean(name='Success', example='True'),
  userMessage?: string(name='UserMessage', example='*'),
}

model GetProductListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetProductListResponseBody(name='body'),
}

/**
 * @summary 获取云产品的列表
 *
 * @param request GetProductListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetProductListResponse
 */
async function getProductListWithOptions(request: GetProductListRequest, runtime: Util.RuntimeOptions): GetProductListResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.token)) {
    query['Token'] = request.token;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetProductList',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取云产品的列表
 *
 * @param request GetProductListRequest
 * @return GetProductListResponse
 */
async function getProductList(request: GetProductListRequest): GetProductListResponse {
  var runtime = new Util.RuntimeOptions{};
  return getProductListWithOptions(request, runtime);
}

model GetTaskStatusByIdRequest {
  taskId?: string(name='TaskId', description='This parameter is required.', example='95906135'),
}

model GetTaskStatusByIdResponseBody = {
  data?: {
    taskId?: long(name='TaskId', example='95906135'),
    taskStatus?: int32(name='TaskStatus', example='1'),
  }(name='Data'),
  requestId?: string(name='RequestId', example='566331F9-5AB3-550F-B745-A730331F97A9'),
}

model GetTaskStatusByIdResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetTaskStatusByIdResponseBody(name='body'),
}

/**
 * @summary 根据id获取任务状态
 *
 * @param request GetTaskStatusByIdRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetTaskStatusByIdResponse
 */
async function getTaskStatusByIdWithOptions(request: GetTaskStatusByIdRequest, runtime: Util.RuntimeOptions): GetTaskStatusByIdResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetTaskStatusById',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 根据id获取任务状态
 *
 * @param request GetTaskStatusByIdRequest
 * @return GetTaskStatusByIdResponse
 */
async function getTaskStatusById(request: GetTaskStatusByIdRequest): GetTaskStatusByIdResponse {
  var runtime = new Util.RuntimeOptions{};
  return getTaskStatusByIdWithOptions(request, runtime);
}

model RefreshAdvisorCheckRequest {
  assumeAliyunId?: long(name='AssumeAliyunId'),
  checkId?: string(name='CheckId', example='EcsHighCpuUtilization'),
  checkPlanId?: long(name='CheckPlanId'),
  language?: string(name='Language', example='zh'),
  product?: string(name='Product', example='ecs'),
  resourceDimensionList?: [ 
    {
      cost?: boolean(name='Cost'),
      performance?: boolean(name='Performance'),
      product?: string(name='Product'),
      productName?: string(name='ProductName'),
      reliablility?: boolean(name='Reliablility'),
      security?: boolean(name='Security'),
      service?: boolean(name='Service'),
    }
  ](name='ResourceDimensionList'),
  resourceId?: string(name='ResourceId', example='i-bp67acfmxazb4p****'),
  token?: string(name='Token'),
}

model RefreshAdvisorCheckShrinkRequest {
  assumeAliyunId?: long(name='AssumeAliyunId'),
  checkId?: string(name='CheckId', example='EcsHighCpuUtilization'),
  checkPlanId?: long(name='CheckPlanId'),
  language?: string(name='Language', example='zh'),
  product?: string(name='Product', example='ecs'),
  resourceDimensionListShrink?: string(name='ResourceDimensionList'),
  resourceId?: string(name='ResourceId', example='i-bp67acfmxazb4p****'),
  token?: string(name='Token'),
}

model RefreshAdvisorCheckResponseBody = {
  data?: {
    message?: string(name='Message'),
    success?: boolean(name='Success', example='true'),
    taskId?: long(name='TaskId', example='12345678'),
    traceId?: string(name='TraceId', example='manual-1be17af1121b4974822e69daee4f2481'),
  }(name='Data'),
  requestId?: string(name='RequestId', example='566331F9-5AB3-550F-B745-A730331F97A9'),
}

model RefreshAdvisorCheckResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RefreshAdvisorCheckResponseBody(name='body'),
}

/**
 * @summary 触发立即巡检
 *
 * @param tmpReq RefreshAdvisorCheckRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RefreshAdvisorCheckResponse
 */
async function refreshAdvisorCheckWithOptions(tmpReq: RefreshAdvisorCheckRequest, runtime: Util.RuntimeOptions): RefreshAdvisorCheckResponse {
  Util.validateModel(tmpReq);
  var request = new RefreshAdvisorCheckShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.resourceDimensionList)) {
    request.resourceDimensionListShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.resourceDimensionList, 'ResourceDimensionList', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.assumeAliyunId)) {
    query['AssumeAliyunId'] = request.assumeAliyunId;
  }
  if (!Util.isUnset(request.checkId)) {
    query['CheckId'] = request.checkId;
  }
  if (!Util.isUnset(request.checkPlanId)) {
    query['CheckPlanId'] = request.checkPlanId;
  }
  if (!Util.isUnset(request.language)) {
    query['Language'] = request.language;
  }
  if (!Util.isUnset(request.product)) {
    query['Product'] = request.product;
  }
  if (!Util.isUnset(request.resourceId)) {
    query['ResourceId'] = request.resourceId;
  }
  if (!Util.isUnset(request.token)) {
    query['Token'] = request.token;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.resourceDimensionListShrink)) {
    body['ResourceDimensionList'] = request.resourceDimensionListShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'RefreshAdvisorCheck',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 触发立即巡检
 *
 * @param request RefreshAdvisorCheckRequest
 * @return RefreshAdvisorCheckResponse
 */
async function refreshAdvisorCheck(request: RefreshAdvisorCheckRequest): RefreshAdvisorCheckResponse {
  var runtime = new Util.RuntimeOptions{};
  return refreshAdvisorCheckWithOptions(request, runtime);
}

model RefreshAdvisorCostCheckRequest {
  assumeAliyunIdList?: [ long ](name='AssumeAliyunIdList'),
  checkIds?: [ string ](name='CheckIds'),
  checkPlanId?: long(name='CheckPlanId'),
  product?: string(name='Product', example='ecs'),
  refreshResource?: boolean(name='RefreshResource', example='false'),
  resourceIds?: [ string ](name='ResourceIds'),
}

model RefreshAdvisorCostCheckShrinkRequest {
  assumeAliyunIdListShrink?: string(name='AssumeAliyunIdList'),
  checkIdsShrink?: string(name='CheckIds'),
  checkPlanId?: long(name='CheckPlanId'),
  product?: string(name='Product', example='ecs'),
  refreshResource?: boolean(name='RefreshResource', example='false'),
  resourceIdsShrink?: string(name='ResourceIds'),
}

model RefreshAdvisorCostCheckResponseBody = {
  code?: string(name='Code', example='200'),
  data?: {
    commandId?: string(name='CommandId', example='c-wl*****n0g'),
    managerTaskId?: long(name='ManagerTaskId', example='11***********35'),
    success?: boolean(name='Success', example='true'),
    taskId?: long(name='TaskId', example='959***135'),
  }(name='Data'),
  message?: string(name='Message', example='OK'),
  requestId?: string(name='RequestId', description='Id of the request', example='566331F9-****-550F-B745-A730331F97A9'),
  success?: boolean(name='Success', example='True'),
}

model RefreshAdvisorCostCheckResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RefreshAdvisorCostCheckResponseBody(name='body'),
}

/**
 * @summary 发起成本优化巡检
 *
 * @param tmpReq RefreshAdvisorCostCheckRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RefreshAdvisorCostCheckResponse
 */
async function refreshAdvisorCostCheckWithOptions(tmpReq: RefreshAdvisorCostCheckRequest, runtime: Util.RuntimeOptions): RefreshAdvisorCostCheckResponse {
  Util.validateModel(tmpReq);
  var request = new RefreshAdvisorCostCheckShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.assumeAliyunIdList)) {
    request.assumeAliyunIdListShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.assumeAliyunIdList, 'AssumeAliyunIdList', 'json');
  }
  if (!Util.isUnset(tmpReq.checkIds)) {
    request.checkIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.checkIds, 'CheckIds', 'json');
  }
  if (!Util.isUnset(tmpReq.resourceIds)) {
    request.resourceIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.resourceIds, 'ResourceIds', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.assumeAliyunIdListShrink)) {
    query['AssumeAliyunIdList'] = request.assumeAliyunIdListShrink;
  }
  if (!Util.isUnset(request.checkIdsShrink)) {
    query['CheckIds'] = request.checkIdsShrink;
  }
  if (!Util.isUnset(request.checkPlanId)) {
    query['CheckPlanId'] = request.checkPlanId;
  }
  if (!Util.isUnset(request.product)) {
    query['Product'] = request.product;
  }
  if (!Util.isUnset(request.refreshResource)) {
    query['RefreshResource'] = request.refreshResource;
  }
  if (!Util.isUnset(request.resourceIdsShrink)) {
    query['ResourceIds'] = request.resourceIdsShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'RefreshAdvisorCostCheck',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 发起成本优化巡检
 *
 * @param request RefreshAdvisorCostCheckRequest
 * @return RefreshAdvisorCostCheckResponse
 */
async function refreshAdvisorCostCheck(request: RefreshAdvisorCostCheckRequest): RefreshAdvisorCostCheckResponse {
  var runtime = new Util.RuntimeOptions{};
  return refreshAdvisorCostCheckWithOptions(request, runtime);
}

model RefreshAdvisorResourceRequest {
  product?: string(name='Product', description='This parameter is required.', example='ecs'),
  resourceId?: string(name='ResourceId', example='i-bp67acfmxazb4p****'),
}

model RefreshAdvisorResourceResponseBody = {
  data?: long(name='Data', example='12345678'),
  requestId?: string(name='RequestId', example='566331F9-5AB3-550F-B745-A730331F97A9'),
}

model RefreshAdvisorResourceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RefreshAdvisorResourceResponseBody(name='body'),
}

/**
 * @summary RefreshAdvisorResource
 *
 * @param request RefreshAdvisorResourceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RefreshAdvisorResourceResponse
 */
async function refreshAdvisorResourceWithOptions(request: RefreshAdvisorResourceRequest, runtime: Util.RuntimeOptions): RefreshAdvisorResourceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.product)) {
    query['Product'] = request.product;
  }
  if (!Util.isUnset(request.resourceId)) {
    query['ResourceId'] = request.resourceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'RefreshAdvisorResource',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary RefreshAdvisorResource
 *
 * @param request RefreshAdvisorResourceRequest
 * @return RefreshAdvisorResourceResponse
 */
async function refreshAdvisorResource(request: RefreshAdvisorResourceRequest): RefreshAdvisorResourceResponse {
  var runtime = new Util.RuntimeOptions{};
  return refreshAdvisorResourceWithOptions(request, runtime);
}

model ReportBizAlertInfoRequest {
  alertDescription?: string(name='AlertDescription'),
  alertDetail?: string(name='AlertDetail', description='This parameter is required.'),
  alertGrade?: string(name='AlertGrade'),
  alertLabels?: string(name='AlertLabels'),
  alertScene?: string(name='AlertScene', description='This parameter is required.'),
  alertToken?: string(name='AlertToken', description='This parameter is required.'),
  alertUid?: [ long ](name='AlertUid'),
  language?: string(name='Language'),
}

model ReportBizAlertInfoShrinkRequest {
  alertDescription?: string(name='AlertDescription'),
  alertDetail?: string(name='AlertDetail', description='This parameter is required.'),
  alertGrade?: string(name='AlertGrade'),
  alertLabels?: string(name='AlertLabels'),
  alertScene?: string(name='AlertScene', description='This parameter is required.'),
  alertToken?: string(name='AlertToken', description='This parameter is required.'),
  alertUidShrink?: string(name='AlertUid'),
  language?: string(name='Language'),
}

model ReportBizAlertInfoResponseBody = {
  code?: string(name='Code'),
  data?: {
    result?: string(name='Result'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ReportBizAlertInfoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ReportBizAlertInfoResponseBody(name='body'),
}

/**
 * @summary 上报用户业务报警信息
 *
 * @param tmpReq ReportBizAlertInfoRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ReportBizAlertInfoResponse
 */
async function reportBizAlertInfoWithOptions(tmpReq: ReportBizAlertInfoRequest, runtime: Util.RuntimeOptions): ReportBizAlertInfoResponse {
  Util.validateModel(tmpReq);
  var request = new ReportBizAlertInfoShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.alertUid)) {
    request.alertUidShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.alertUid, 'AlertUid', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.alertDescription)) {
    query['AlertDescription'] = request.alertDescription;
  }
  if (!Util.isUnset(request.alertDetail)) {
    query['AlertDetail'] = request.alertDetail;
  }
  if (!Util.isUnset(request.alertGrade)) {
    query['AlertGrade'] = request.alertGrade;
  }
  if (!Util.isUnset(request.alertLabels)) {
    query['AlertLabels'] = request.alertLabels;
  }
  if (!Util.isUnset(request.alertScene)) {
    query['AlertScene'] = request.alertScene;
  }
  if (!Util.isUnset(request.alertToken)) {
    query['AlertToken'] = request.alertToken;
  }
  if (!Util.isUnset(request.alertUidShrink)) {
    query['AlertUid'] = request.alertUidShrink;
  }
  if (!Util.isUnset(request.language)) {
    query['Language'] = request.language;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ReportBizAlertInfo',
    version = '2018-01-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 上报用户业务报警信息
 *
 * @param request ReportBizAlertInfoRequest
 * @return ReportBizAlertInfoResponse
 */
async function reportBizAlertInfo(request: ReportBizAlertInfoRequest): ReportBizAlertInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  return reportBizAlertInfoWithOptions(request, runtime);
}

